package cn.cjxy.service.impl;

import cn.cjxy.domain.Student;
import cn.cjxy.mapper.StudentMapper;
import cn.cjxy.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * 业务层
 * service实现类
 */
@Service
public class StudentServiceImpl implements StudentService {
    //导入mapper层
    @Autowired
    private StudentMapper studentMapper;

    @Override
    public List<Student> findAll() {
        //业务处理
        return studentMapper.findAll();
    }

    @Override
    public Student findById(Long id) {
        //业务处理
        return studentMapper.findById(id);
    }

    @Override
    public void save(Student student) {
        //业务处理
        studentMapper.save(student);
    }

    @Override
    public void update(Student student) {
        //业务处理
        studentMapper.update(student);
    }

    @Override
    public void delete(Long id) {
        //业务处理
        studentMapper.delete(id);
    }

    /**
     * 登录逻辑
     * @param student
     * @return
     */
    @Override
    public Student login(Student student) {

        return null;
    }
}
